package service;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.session.SqlSessionFactory;
import service.Impl.ICartServiceImpl;
import service.Impl.IClerkServiceImpl;
import service.Impl.IClientServiceImpl;
import service.Impl.IUserServiceImpl;
import utils.WebUtils;
import vo.Cart;
import vo.Clerk;
import vo.Client;
import vo.User;

import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.sql.SQLException;
import java.util.List;

public class Test extends HttpServlet{
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //设置编码
        request.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        //获取输入流
       JSONObject jsonObject= (JSONObject) getServletContext().getAttribute("books");
       response.getWriter().write(jsonObject.toString());
    }
}
